]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st: Bail out on clipboard requests if there is no text.
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 10 Oct 2014 17:12:27 +0000 (19:12 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 10 Oct 2014 17:37:40 +0000 (19:37 +0200)
If a selection request happens through foreign means, the selected
text is NULL, and a crash happens.

https://bugzilla.gnome.org/show_bug.cgi?id=738314

src/st/st-clipboard.c

index a09360dd5cdfc6324d2cc808da534d0e3d072681..32da14236606f79d834da24738f5763994aee457 100644 (file)
@@ -119,7 +119,8 @@ st_clipboard_provider (GdkXEvent *xevent_p,
   XSelectionRequestEvent *req_event;
   GdkDisplay *display = gdk_display_get_default ();
 
-  if (xev->type != SelectionRequest)
+  if (xev->type != SelectionRequest ||
+      !clipboard->priv->clipboard_text)
     return GDK_FILTER_CONTINUE;
 
   req_event = &xev->xselectionrequest;